package com.wench.design.pattern.flyweight;

/**
 * @author WenchGuo
 * @date 2021/11/26 10:52
 */
public class FlyweightClient {

    public static void main(String[] args) {
        AbstractBox iBox = BoxFactory.getInstance().getShape("I");
        iBox.display("gray");

        AbstractBox lBox = BoxFactory.getInstance().getShape("L");
        lBox.display("blue");

        AbstractBox oBox = BoxFactory.getInstance().getShape("O");
        oBox.display("white");

        AbstractBox oBox1 = BoxFactory.getInstance().getShape("O");
        oBox1.display("red");

        System.out.println(oBox == oBox1);
    }
}
